import request from '@/utils/request'

export function login(data) {
  // return request({
  //   url: '/v1/docs',
  //   method: 'post',
  //   data: {  }
  // })

  return new Promise(function(resolve, reject){
		//做一些异步操作
		setTimeout(function(){
			console.log('假登录，后面改');
			resolve({"code":20000,"data":{"token":"admin-token"}});
		}, 500);
	});
}

export function getInfo(token) {
  // return request({
  //   url: '/vue-admin-template/user/info',
  //   method: 'get',
  //   params: { token }
  // })
  return new Promise(function(resolve, reject){
    setTimeout(function(){
      console.log('假获取，后面改');
      resolve({"code":20000,"data":{"roles":["admin"],"introduction":"I am a super administrator","avatar":"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif","name":"Super Admin"}});
    }, 500);
  });
}

export function logout() {
  // return request({
  //   url: '/vue-admin-template/user/logout',
  //   method: 'post'
  // })
  return new Promise(function(resolve, reject){
    setTimeout(function(){
      console.log('假注销，后面改');
      resolve({"code":20000,"data":"success"});
    }, 500);
  });
}
